package com.nthink.indicators.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * @author Angus Yu
 * @date 2021-03-29 16:55
 */
@Configuration
public class SwaggerConfig {

    @Bean
    public Docket api(){
        return new Docket(DocumentationType.SWAGGER_2)
                .apiInfo(apiInfo())
                .groupName("林纳尔多")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.nthink.indicators.controller"))
//                .apis(RequestHandlerSelectors.any()) //扫描所有
                .paths(PathSelectors.any())
                .build();
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("SwaggerAPI文档")
                .description("医院管理统计指标")
                .termsOfServiceUrl("")
                .build();
    }


}
